package com.redheart.web.controller.sys;

import com.redheart.web.entity.SysUserEntity;
import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AbstractController {
    protected Logger logger= LoggerFactory.getLogger(this.getClass());

    protected SysUserEntity getUser(){
        return (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
    }

    protected Long getUserId() {
        return getUser().getUserId();
    }

    protected Long getDeptId() {
        return getUser().getSysDeptEntity().getDeptId();
    }
}
